<?php
declare(strict_types=1);

namespace plugin\ky_black\app\model;

use support\Model;

class Employee extends Model
{
    /**
     * The table associated with the model.
     *
     * @var string
     */
    protected $table = 'black_employees';

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'partner_id',
        'name',
        'phone',
        'id_card',
        'position',
        'avatar',
        'status',
        'remark'
    ];

    /**
     * The attributes that should be cast.
     *
     * @var array
     */
    protected $casts = [
        'partner_id' => 'integer',
        'status' => 'integer',
        'created_at' => 'datetime',
        'updated_at' => 'datetime'
    ];

    /**
     * 关联合作商家
     */
    public function partner()
    {
        return $this->belongsTo(Partner::class, 'partner_id');
    }
} 